home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / share / laptop-mode-tools / modules / ac97-powersave next >
Encoding:
Text File  |  2012-05-20  |  1.2 KB  |  27 lines

  1. #! /bin/sh
  2. # Laptop mode tools module: Intel AC97 integrated audio power saving mode.
  3. #
  4.  
  5. if [ x$CONTROL_AC97_POWER = x1 ] || [ x$ENABLE_AUTO_MODULES = x1 -a x$CONTROL_AC97_POWER = xauto ]; then
  6.     if [ -w /sys/module/snd_ac97_codec/parameters/power_save ]; then
  7.         echo 1 > /sys/module/snd_ac97_codec/parameters/power_save
  8.         log "VERBOSE" "AC97 power save mode enabled."
  9.                 if [ -c /dev/dsp ]; then
  10.                         # This can fail if the audio device is busy.
  11.                         # Since this failure is non-fatal (worst case is that the timer changes
  12.                         # don't get activated), we don't bother if it was successful or not
  13.                         #(exec 2>/dev/null; echo 1 > /dev/dsp;)
  14.                         # Better way
  15.                         echo 1 2>/dev/null >/dev/dsp
  16.                         log "VERBOSE" "Initialize timer change by close/open /dev/dsp"
  17.                 fi
  18.     else
  19.         log "VERBOSE" "AC97 power saving is not available. Perhaps CONFIG_SND_AC97_POWER_SAVE option"
  20.         log "VERBOSE" "is not set in the kernel config, or the snd_ac97_codec module is not loaded."
  21.     fi
  22. else
  23.     log "VERBOSE" "AC97 audio power setting is disabled."
  24. fi
  25.  
  26.